#include<iostream>

#include<list>
using namespace std;

template <class T>
void show(list<T> t1)
{
	for (auto l : t1)
	{
		cout << l << " ";
	}
	cout << endl;
}

void test_1()
{
	list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_front(666);

	show(lt1);

	lt1.pop_back();
	lt1.pop_front();

	show(lt1);

	auto it1 = lt1.begin();
	lt1.erase(it1);
	lt1.push_front(00);
	lt1.push_front(01);
	lt1.push_front(02);
	show(lt1);


	list<int>::iterator it = find(lt1.begin(), lt1.end(), 3);
	lt1.insert(it, 999);
	show(lt1);
}

void test_2()
{
	list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_front(666);

	show(lt1);
	lt1.reverse();
	show(lt1);
}

int main()
{
	//test_1();
	test_2();
	return 0;
}